home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
STRINGS
/
PACKAGE6
/
LENGTH.DOC
< prev
next >
Wrap
Text File
|
1990-07-25
|
1KB
|
36 lines
----------------------------------------------------------------------------
LengthOfString
----------------------------------------------------------------------------
declaration: function LengthOfString ( AString:
TypeString): integer;
purpose: Returns the number of characters in a string.
preconditions: AString was originally initalized.
postconditions: 0 <= LengthOfString <= MaxStringLength
special cases: none
example: var
Name:
TypeString;
LastKey:
TypeKey;
begin
.
.
.
ReadLnString (Name, MaxStringLength, LastKey);
write (output , 'Your name is ');
write (output, LengthOfString (Name));
writeln (output, 'characters long.')
.
.
.
end
----------------------------------------------------------------------------